package com.yanqu.road.server.cmd.passRoad;

import com.yanqu.road.entity.enums.eLogMoneyType;
import com.yanqu.road.entity.log.LogOpenMiniGameChose;
import com.yanqu.road.entity.player.UserBagItem;
import com.yanqu.road.entity.player.UserHistoryAttribute;
import com.yanqu.road.logic.config.GameConfig;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.pass.RoadProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.player.BagModule;
import com.yanqu.road.server.gameplayer.module.player.CurrencyModule;
import com.yanqu.road.server.gameplayer.module.player.PlayerModule;
import com.yanqu.road.server.manger.log.AutoLogMgr;
import com.yanqu.road.server.manger.system.MiniGameConfigMgr;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.property.Property;
import com.yanqu.road.utils.property.PropertyHelper;

import java.math.BigInteger;

@Cmd(code = Protocol.S_PASS_ROAD_OPEN_MINIGAME_CHOSE, desc = "开局小游戏选择的小游戏ID")
public class PassRoadOpenGameChoseCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        RoadProto.OpenMiniGameChoseReqMsg reqMsg = RoadProto.OpenMiniGameChoseReqMsg.parseFrom(packet.getBytes());
        int gameId = reqMsg.getGameId();
        if (!MiniGameConfigMgr.hasMiniGame(gameId)) {
            log.error("PassRoadOpenGameChoseCmd gameId={} not found!!", gameId);
            return;
        }
        AutoLogMgr.add(new LogOpenMiniGameChose(player.getUserId(), gameId));
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
